import { createRouter, createWebHashHistory } from 'vue-router'
import HomeIndexView from '@/views/home/HomeIndexView.vue'
import ShopIndexView from '@/views/shop/ShopIndexView.vue'
import PublishArticleView from '@/views/PublishArticleView.vue'
import ChatIndexView from '@/views/chat/ChatIndexView.vue'
import UserIndexView from '@/views/user/UserIndexView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: "/home/index/",
  },
  {
    path: '/home/index/',
    name: 'home_index',
    component: HomeIndexView
  },
  {
    path: '/shop/index/',
    name: 'shop_index',
    component: ShopIndexView
  },
    {
    path: '/publish/index/',
    name: 'publish_index',
    component: PublishArticleView
  },
  {
    path: '/chat/index/',
    name: 'chat_index',
    component: ChatIndexView
  },
  {
    path: '/user/index/',
    name: 'user_index',
    component: UserIndexView
  },
  

  {
    path: "/:catchAll(.*)",
    redirect: "/404/"
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
